<template>
  <view class="containt" v-if="state.userinfo.memberCertificate&&state.userinfo.memberCertificate.auditStatus==1">
    <view>
      <image
        class="rensuccess"
        mode="widthFix"
        src="@/static/img/rensuccess.png"
      ></image>
      <view class="title">认证成功</view>
      <view class="huitext">祝您使用愉快</view>
      <view class="huibox">
        <view>
          <text class=""> 真实姓名：</text>
          <text class="">{{state.userinfo.memberCertificate.certificateName}} </text>
        </view>
        <view>
          <text class=""> 证件类型：</text>
          <text class="">  {{state.userinfo.memberCertificate.certificateType==1?'身份证':'企业证'}}</text>
        </view>
        <view>
          <text class=""> 证件号码：</text>
          <text class=""> {{state.userinfo.memberCertificate.certificateCardNumber}} </text>
        </view>
      </view>
      <view class="knowbtn" @tap="goback()">去首页看看</view>
    </view>

    <view class="footbox">
      <view class="tip"
        >若您在公安机关变更了姓名，可点此<text class="bluetext"
          >更新本人实名信息</text
        ></view
      >
      <view class="tip"
        >若账号实名人非账号实际使用人，可点此<text class="bluetext"
          >更正实名人</text
        >
      </view>
    </view>
  </view>
  <view class="containt" v-else-if="state.userinfo.memberCertificate&&state.userinfo.memberCertificate.auditStatus==0">
    <view>
      <image
        class="rensuccess"
        mode="widthFix"
        src="@/static/img/padding.png"
      ></image>
      <view class="title">认证审核中</view>
      <view class="huitext">正在认真审核，请耐心等待</view>

      <view class="knowbtn" @tap="goback()">去首页看看</view>
    </view>
  </view>
  <view class="containt" v-else-if="state.userinfo.memberCertificate&&state.userinfo.memberCertificate.auditStatus==2">
    <view>
      <image
        class="rensuccess"
        mode="widthFix"
        src="@/static/img/renerror.png"
      ></image>
      <view class="title">认证失败</view>
      <view class="huitext">证件号码和姓名不匹配</view>

      <view class="editbtn" @tap="goedit()">去修改</view>
    </view>
  </view>
</template>

<script lang="ts" setup>
import { onLoad } from "@dcloudio/uni-app";
import { ref,reactive } from "vue";

// const auditStatus=ref(0)
const state=reactive({
  userinfo:{}
})
onLoad((options) => {
  // console.log(options)
  // .value= options.auditStatus
  state.userinfo = JSON.parse(uni.getStorageSync("userinfo"));
  console.log(state.userinfo.memberCertificate)
})
const goedit=()=>{
  uni.navigateTo({
        url: `/pages/me/authentication?id=${state.userinfo.id}`,
      });
}
const goback=()=>{
  // uni.navigateBack()
  uni.navigateTo({
        url: `/pages/bar`,
      });
}
</script>
<style lang="scss">
page {
  background: #ffffff;
}
</style>
<style lang="scss" scoped>
.containt {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 33rpx;
  text-align: center;
  .rensuccess {
    width: 161rpx;
    height: 161rpx;
    margin: 0 auto;
    margin-top: 150rpx;
  }
  .title {
    font-size: 30rpx;
    font-weight: 500;
    margin-top: 47rpx;
    margin-bottom: 14rpx;
  }
  .huitext {
    font-size: 26rpx;
    color: #8a8f99;
  }
  .huibox {
    text-align: left;
    background: #f5f5f5;
    border-radius: 8rpx;
    padding: 33rpx;
    margin-top: 47rpx;
    font-size: 26rpx;
    color: #666666;
    line-height: 52rpx;
  }
  .tip {
    font-size: 24rpx;
    color: #8a8f99;
    margin-bottom: 18rpx;
  }
  .knowbtn {
    margin: 0 auto;
    text-align: center;
    width: 494rpx;
    height: 90rpx;
    line-height: 90rpx;
    border-radius: 8rpx;
    border: 2rpx solid #953B82;
    font-size: 30rpx;
    color: #333333;
    margin-top: 63rpx;
  }
  .editbtn {
    margin: 0 auto;
    text-align: center;
    width: 494rpx;
    height: 90rpx;
    line-height: 90rpx;
    background: #953B82;
    border-radius: 8rpx;
    margin-top: 63rpx;
    font-size: 27rpx;
    color: #ffffff;
  }
  .bluetext {
    color: #79a9ff;
  }
  .footbox {
    flex: 1;
    text-align: center;
    margin-top: 200rpx;
  }
}
</style>
